package com.emapp.lccode.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.emapp.lccode.bean.DeviceKt
import com.emapp.lccode.databinding.ListitemDeviceBinding
import com.emapp.lccode.databinding.ListitemOrderBinding

class DeviceKtAdapter : BaseQuickAdapter<DeviceKt, DeviceKtAdapter.VH>() {

    class VH(
        parent: ViewGroup,
        val binding: ListitemDeviceBinding = ListitemDeviceBinding.inflate(
            LayoutInflater.from(parent.context), parent, false
        ),
    ) : RecyclerView.ViewHolder(binding.root)

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): VH {
        return VH(parent)
    }

    override fun onBindViewHolder(holder: VH, position: Int, item: DeviceKt?) {
        holder.binding.tvName.text = item?.name
        holder.binding.tvAddress.text = item?.area_city
        holder.binding.tvTime.text = item?.create_time
        holder.binding.tvState.visibility= View.INVISIBLE
//        when (item?.check_status) {
//            0 -> {//未派单
//                if (item?.checkIds?.contains(BaseApplication.instance.adminId.toInt()) == true) {//该我派单
//                    holder.binding.tvState.text = "待派单"
//                } else
//                    holder.binding.tvState.text = "待审核"
//            }
//
//            1 -> {//派单后
//                if (item?.checkIds?.contains(BaseApplication.instance.adminId.toInt()) == true) {//该我回复了
//                    holder.binding.tvState.text = "待回复"
//                } else
//                    holder.binding.tvState.text = "已派单"
//            }
//
//            2 -> {
//                holder.binding.tvState.text = "已回复"
//            }
//
//            3 -> {
//                holder.binding.tvState.text = "审核不通过"
//            }
//
//            4 -> {
//                holder.binding.tvState.text = "撤销审核"
//            }
//        }
    }


}